package com.kfm.review;

import com.kfm.movie.User;

import java.util.Objects;

public class Demo01 {

    public static void main(String[] args) {
        User user = null;

        System.out.println(Objects.equals(new User(), new User()));
        System.out.println(Objects.toString(new User()));
        System.out.println(Objects.nonNull(new User())); // true 不是null
        System.out.println(Objects.nonNull(user)); // false
        System.out.println(Objects.isNull(user)); // 是null
        System.out.println(Objects.isNull(new User())); // false
//        System.out.println(user.getUsername());
        Objects.requireNonNull(user, "user不能为null");
    }
}
